package com.Maykk.Demo01;

/**
 * @ClassName: com.Maykk.Demo01.MyThread
 * @Description: TODO 自定义多线程
 * @Author: MaykkStar@163.com
 */
public class MyThread extends Thread {
    public MyThread() {
        super();
    }

    public MyThread(String name) {
        super(name);
    } // 重写带参构造方法后要将无参构造方法也重写，否则无法实例化无参对象

    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println(this.getName() + " " + i);
        }
    }
}
